Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors due to closure on search by course id endpoints #214

Merged
merged 47 commits into from
Dec 21, 2023

Conversation

James-Lu-none
Copy link
Collaborator

@James-Lu-none James-Lu-none commented Dec 2, 2023

Description

Over all: this pr fix impacts and errors due to service policy changes on school server endpoints which closes the functionality to search course extra information by course id and search course table by student id

fix unknown charaters in english course table

use utf-8 encoding instead of big5 in requests.

fix semester year and phase parsers

The title String of the first course table was stored seperately in its element,
but it currently stores all the information in a row,
image
so the RegExp "studentSemesterDetailFilter" is used to filter out only the number parts
and the List "studentSemesterDetails" should consist of three numerical values (ex: [110310144, 112, 1])

fix unable to get course category symbol

Impacts

  • unable to summary score properly

The tasks of search course extra information by course id contain retriving course category symbols which are crutial in functionality of summarizing credits and is currently not working properly because its not there anymore, so i made an additional request to the href where the "課程大綱" is placed and search for course category symbol there instead.
image
image

rewrite courseExtraInfo parser

Impacts

  • no color variety of chinese course table
  • unable to check details in chinese course table
  • unable to fetch grade and scores

The color variety of course table and fetch grade and scores functionalities rely on courseExtraInfo.course.id, and since the course id on the second course table is no longer wrapped in <a> tag, so currently we parse it from the <td> tag instead.
image

Implementation

  1. course table
  • fix unknown charaters in english course table
  1. course extra info
  • fix semester year and phase parsers
  • fix unable to get course category symbol
  • rewrite courseExtraInfo parser
  1. impacts relate to changes above
  • unable to fetch grade and scores
  • unable to summary score properly
  • no color variety of chinese course table
  • unable to check details in chinese course table
  1. feature removal
  • remove classmate node parser
  • remove classmate searching feature widgets

Testing Instructions

  • build the project and check features above is working properly on AOS
  • build the project and check features above is working properly on IOS

Additional Notes

Copy link
Collaborator

@rileychh rileychh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to verify that all problems below are fixed on Android.

  1. course table
  • fix unknown charaters in english course table ("Class Meeting" shows empty details instead of "tofu"s)
  1. course extra info
  • fix semester year and phase parsers (able to change and read other semesters correctly)
  • fix unable to get course category symbol
  • rewrite courseExtraInfo parser
  1. impacts relate to changes above
  • unable to fetch grade and scores
  • unable to summary score properly
  • no color variety of chinese course table
  • unable to check details in chinese course table
  1. feature removal
  • remove classmate node parser
  • remove classmate searching feature widgets

lib/ui/pages/coursetable/course_table_page.dart Outdated Show resolved Hide resolved
James-Lu-none

This comment was marked as off-topic.

Copy link
Member

@Xanonymous-GitHub Xanonymous-GitHub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Collaborator

@ntut-xuan ntut-xuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two exists bugs:

  • [Critical] When the user not complete the final education survay(期末教學評量)will cause the application crash.
  • [Critical] When some course not have sallybus href, it will cause the score calculate system crash.

@James-Lu-none
Copy link
Collaborator Author

James-Lu-none commented Dec 18, 2023

the issue

[Critical] When the user not complete the final education survay(期末教學評量)will cause the application crash.

was fixed in 3f1e6da & ed3a835, and a notification of unfinished education survay should be implemented

@rileychh rileychh self-requested a review December 18, 2023 13:14
Copy link
Collaborator

@rileychh rileychh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I finally made it work on iOS, yay!
After merging into the master branch on my machine, I was able to bypass the force-update dialog.
Since the student ID input box in the course table is now read-only, users of the previous version who tried using others' IDs will not be able to change it back. Switching the language to English and then back again solves this issue.
I also discovered that the score lookup is failing again. It reports to the normal user that there are no scores yet:

Image

But in my debug build for Android, I encounter a RangeError:

Image

lib/src/connector/course_connector.dart Outdated Show resolved Hide resolved
lib/src/connector/course_connector.dart Outdated Show resolved Hide resolved
lib/src/connector/course_connector.dart Outdated Show resolved Hide resolved
lib/src/connector/course_connector.dart Outdated Show resolved Hide resolved
lib/src/connector/score_connector.dart Outdated Show resolved Hide resolved
@ntut-xuan ntut-xuan merged commit 1ee8c73 into master Dec 21, 2023
4 checks passed
@ntut-xuan ntut-xuan deleted the parser_on_couse_id_error branch December 21, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants